import java.util.Arrays;

public class L455 {

    public static void main(String[] args) {
        int[] g = {1, 2, 3}, s = {1, 1};

        int contentChildren = new Solution().findContentChildren(g, s);
        System.out.println(contentChildren);
    }


    static class Solution {
        public int findContentChildren(int[] g, int[] s) {
            Arrays.sort(g);
            Arrays.sort(s);
            int j = 0;
            int res = 0;
            for (int k : s) {
                if (g[j] <= k) {
                    j++;
                    res++;
                }
                if (j >= g.length) {
                    break;
                }
            }
            return res;
        }
    }

}
